package DataTable
{
	public class CGameDataTable
	{
		private const TIME_TO_CREATE_CREAMPUFF_LEVEL0	:Number = 5.0;
		private const TIME_TO_CREATE_CREAMPUFF_LEVEL1	:Number = 4.0;
		private const TIME_TO_CREATE_CREAMPUFF_LEVEL2	:Number = 3.0;
		private const TIME_TO_CREATE_CREAMPUFF_LEVEL3	:Number = 2.0;
		private const TIME_TO_CREATE_CREAMPUFF_LEVEL4	:Number = 1.0;
		private const TIME_TO_CREATE_CREAMPUFF_LEVEL5	:Number = 0.6;
		private var m_arrTimeToCreateCreamPuffTable :Array;
		
		private const GOLD_TO_UPGRADE_CPF_LEVEL0	:uint	= 10;
		private const GOLD_TO_UPGRADE_CPF_LEVEL1	:uint	= 18;
		private const GOLD_TO_UPGRADE_CPF_LEVEL2	:uint	= 27;
		private const GOLD_TO_UPGRADE_CPF_LEVEL3	:uint	= 37;
		private const GOLD_TO_UPGRADE_CPF_LEVEL4	:uint	= 48;
		private const GOLD_TO_UPGRADE_CPF_LEVEL5	:uint	= 60;
		private var m_arrGoldToUpgradeCPFTable :Array;
		
		public function CGameDataTable()
		{
			m_arrTimeToCreateCreamPuffTable = new Array();
			m_arrTimeToCreateCreamPuffTable.push(TIME_TO_CREATE_CREAMPUFF_LEVEL0);
			m_arrTimeToCreateCreamPuffTable.push(TIME_TO_CREATE_CREAMPUFF_LEVEL1);
			m_arrTimeToCreateCreamPuffTable.push(TIME_TO_CREATE_CREAMPUFF_LEVEL2);
			m_arrTimeToCreateCreamPuffTable.push(TIME_TO_CREATE_CREAMPUFF_LEVEL3);
			m_arrTimeToCreateCreamPuffTable.push(TIME_TO_CREATE_CREAMPUFF_LEVEL4);
			m_arrTimeToCreateCreamPuffTable.push(TIME_TO_CREATE_CREAMPUFF_LEVEL5);
			
			m_arrGoldToUpgradeCPFTable = new Array();
			m_arrGoldToUpgradeCPFTable.push(GOLD_TO_UPGRADE_CPF_LEVEL0);
			m_arrGoldToUpgradeCPFTable.push(GOLD_TO_UPGRADE_CPF_LEVEL1);
			m_arrGoldToUpgradeCPFTable.push(GOLD_TO_UPGRADE_CPF_LEVEL2);
			m_arrGoldToUpgradeCPFTable.push(GOLD_TO_UPGRADE_CPF_LEVEL3);
			m_arrGoldToUpgradeCPFTable.push(GOLD_TO_UPGRADE_CPF_LEVEL4);
			m_arrGoldToUpgradeCPFTable.push(GOLD_TO_UPGRADE_CPF_LEVEL5);
		}
		public function GetTimeByFactoryLevel(nFactoryLevel :uint) :Number
		{
			if (nFactoryLevel >= m_arrTimeToCreateCreamPuffTable.length)
			{
				return 0;
			}
			return m_arrTimeToCreateCreamPuffTable[nFactoryLevel];
		}
		public function GetGoldForUpgrade(nCurrentFactoryLevel :uint) :uint
		{
			if (nCurrentFactoryLevel >= m_arrGoldToUpgradeCPFTable.length)
			{
				return 0;
			}
			return m_arrGoldToUpgradeCPFTable[nCurrentFactoryLevel];
		}
		
	}
}